﻿package ui.components{
	public class TextButton extends SampleButton{
		private var _text:String
		import flash.text.TextFormatAlign
		function TextButton(text:String, callback:Function = null){
			super(callback)
			
			_text = text;
			var l:Label = new Label(_text, 12, TextFormatAlign.CENTER);
			this.upState 		= new Box().margin(0,0,0,0).fill(0xFFFFFF,1,10).border(1,0x558888).add(new Box().add(l.Clone()))
			this.downState 		= new Box().margin(0,0,0,0).fill(0x558888,1,10).border(1,0x000000).add(new Box().add(l.Clone()))
			this.overState 		= new Box().margin(0,0,0,0).fill(0x55AAAA,1,10).border(1,0x000000).add(new Box().add(l.Clone()))
			this.hitTestState 	= new Box().margin(0,0,0,0).fill(0xFFFFFF,1,10).border(1,0x55AAAA).add(new Box().add(l.Clone()))
			
			_width = l.width + 12
			_height = l.height + 10
			
			redraw()
			
		}
		
	}	
	
}